package utils;

import dao.CountInfoMapper;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class CountInfoDao {
    private volatile static CountInfoMapper countInfoMapper;

    private CountInfoDao() {

    }

    public static CountInfoMapper getInstance() {
        if (countInfoMapper == null) {
            synchronized (UserDao.class) {
                if (countInfoMapper == null) {
                    ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
                    countInfoMapper = ctx.getBean(CountInfoMapper.class);
                }
            }
        }
        return countInfoMapper;
    }
}
